import { post, get, put } from "@/request";

export interface PatientBo {
  deptIds: number[];
  patientName?: string;
  patientContact?: string;
}

export interface MedicalCase {
  id: string;
  patientId: string;
  chiefComplaint: string;
  history: string | null;
  deptId: string;
  images: string | null;
  createdAt: string;
  updatedAt: string;
}

export interface PatientInfo {
  patientId: string;
  patientName: string;
  patientGender: number;
  patientBirth: string;
  patientContact: string;
  addressId: string;
}

export interface User {
  userId: string;
  username: string;
  password: string;
  userContact: string;
  status: string | null;
  openId: string;
  avatar: string | null;
}

export interface PatientResponse {
  patient: PatientInfo;
  medicalCaseList: MedicalCase[];
  users: User[];
}

export interface ApiResponse<T> {
  code: number;
  msg: string;
  data: T;
}

export const list = async (options: PatientBo): Promise<ApiResponse<PatientResponse[]>> => {
  return post<ApiResponse<PatientResponse[]>>("/system/patient/list", options);
};
